package com.ruoyi.system.controller.backend;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.controller.CxBase;
import com.ruoyi.system.domain.StudentInfo;
import com.ruoyi.system.domain.backend.SysBackExStInfo;
import com.ruoyi.system.domain.backend.SysBackPSetInfo;
import com.ruoyi.system.domain.backend.SysBackQSetInfo;
import com.ruoyi.system.domain.backend.SysBackUsrInfo;
import com.ruoyi.system.domain.front.CaseInfoInsertFront;
import com.ruoyi.system.domain.front.FrontUserInfo;
import com.ruoyi.system.service.backend.ISafetyExaminationBackService;
import com.ruoyi.system.service.front.ISafetyExaminationFrontService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

/**
 * 案件信息Controller
 *
 * @author ruoyi
 * @date 2021-04-07
 */
@RestController
@RequestMapping("/system/back/safetyexaminationback")
public class SafetyExaminationBackController extends CxBase {
    @Autowired
    private ISafetyExaminationBackService safetyExaminationBackService;

    /**
     * 查询学院答题统计
     */
    @GetMapping("/selectCollegeExamination")
    public TableDataInfo selectCollegeExamination(SysBackUsrInfo sysBackUsrInfo)
    {
        logput(sysBackUsrInfo,Thread.currentThread().getStackTrace()[1].getMethodName(),this.getClass());
        TableDataInfo tableDataInfo = getDataTable(safetyExaminationBackService.selectCollegeExamination(sysBackUsrInfo));
        logout(tableDataInfo,Thread.currentThread().getStackTrace()[1].getMethodName(),this.getClass());
        return tableDataInfo;
    }

    /**
     * 查询考试记录列表
     */
    @GetMapping("/selectStudentExamination")
    public TableDataInfo selectStudentExamination(SysBackExStInfo sysBackExStInfo)
    {
        logput(sysBackExStInfo,Thread.currentThread().getStackTrace()[1].getMethodName(),this.getClass());
        TableDataInfo tableDataInfo = getDataTable(safetyExaminationBackService.selectStudentExamination(sysBackExStInfo));
        logout(tableDataInfo,Thread.currentThread().getStackTrace()[1].getMethodName(),this.getClass());
        return tableDataInfo;
    }

    /**
     * 设置试卷题目
     */
    @Transactional
    @Log(title = "设置试卷题目", businessType = BusinessType.INSERT)
    @PostMapping("/insertPaperQuestion")
    public AjaxResult insertPaperQuestion(@RequestBody SysBackQSetInfo sysBackQSetInfo)
    {
        logput(sysBackQSetInfo,Thread.currentThread().getStackTrace()[1].getMethodName(),this.getClass());
        return toAjax(safetyExaminationBackService.insertPaperQuestion(sysBackQSetInfo));
    }

    /**
     * 设置考试试卷
     */
    @Transactional
    @Log(title = "设置考试试卷", businessType = BusinessType.INSERT)
    @PostMapping("/insertExaminationPaper")
    public AjaxResult insertExaminationPaper(@RequestBody SysBackPSetInfo sysBackPSetInfo)
    {
        logput(sysBackPSetInfo,Thread.currentThread().getStackTrace()[1].getMethodName(),this.getClass());
        return toAjax(safetyExaminationBackService.insertExaminationPaper(sysBackPSetInfo));
    }



}
